package cn.epsilon3.constant;

/**
 * 统一返回结果enum
 *
 */
public enum ResultEnum {

    SUCCESS(200, "成功"),

    SUCCESS_LOGIN(201, "登录成功"),

    ERROR(500, "失败"),

    AUTH_EXPIRED(401, "身份验证过期，请重新登录"),
    NEED_2FA(402, "需要2FA验证以继续"),
    NO_PERMISSION(403, "权限不足"),

    NOT_FOUND(404, "功能不存在"),

    SYSTEM_CLOSE(404, "系统升级维护中"),

    FEATURE_SUSPENDED(405, "功能升级维护中"),

    OFTEN_REQ(508, "请勿频繁请求"),

    ;


    private final Integer code;

    private final String message;

    ResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return "ResultEnum{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }

}
